package com.example.movie.common.request

import com.example.movie.common.model.BaseResponse
import com.example.movie.data.movie.model.bean.ApproveBean
import com.example.movie.data.movie.model.vo.*
import retrofit2.Call
import retrofit2.http.*


interface MovieService : AbstractService {

    @GET("index")
    fun index(): Call<BaseResponse<MovieListVo>>

    @GET("movieDetail")
    fun movieDetail(@Query("movieId") movieId: Int): Call<BaseResponse<MovieDetailVo>>

    @GET("search")
    fun search(@Query("key") key: String): Call<BaseResponse<List<SearchVo>>>

    @PUT("changeState")
    @FormUrlEncoded
    fun changeUserAndMovieState(
        @Field("movieId") movieId: Int,
        @Field("type") type: Int
    ): Call<BaseResponse<Any>>

    @POST("addForum")
    @FormUrlEncoded
    fun addForum(
        @Field("movieId") movieId: Int,
        @Field("remark") remark: String,
        @Field("pid") pid: Int?,
        @Field("toId") toId:String?,
    ): Call<BaseResponse<Int>>

    @PUT("approve")
    @FormUrlEncoded
    fun approve(
        @Field("forumId") forumId: Int,
    ): Call<BaseResponse<ApproveBean>>

    @GET("pageForumList")
    fun loadForumPage(
        @Query("movieId") movieId: Int,
        @Query("page") page: Int?,
        @Query("size") size: Int?,
    ): Call<BaseResponse<List<ForumVo>>>

    @GET("reply")
    fun loadReplies(
        @Query("forumId") pid: Long,
        @Query("page") page: Int,
        @Query("size") size: Int,
    ): Call<BaseResponse<List<ForumVo>>>

    @GET("movieTop")
    fun loadMovieTopList(): Call<BaseResponse<List<MovieVo>>>

}